package com.aegean.MonitorExamSYS.center.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.MonitorExamSYS.center.business.CenterBusiness;
import com.opensymphony.xwork2.ActionSupport;
@Controller("WriteMessageInfo")
@Scope("prototype")
public class WriteMessageInfo extends ActionSupport {
	private int conduction_Id;
	private String message_Theme;
	private String message_Contents;
	private boolean success;
	private String message;
	
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	@Resource
	CenterBusiness business;
	public int getConduction_Id() {
		return conduction_Id;
	}

	public void setConduction_Id(int conduction_Id) {
		this.conduction_Id = conduction_Id;
	}

	public String getMessage_Theme() {
		return message_Theme;
	}

	public void setMessage_Theme(String message_Theme) {
		this.message_Theme = message_Theme;
	}

	public String getMessage_Contents() {
		return message_Contents;
	}

	public void setMessage_Contents(String message_Contents) {
		this.message_Contents = message_Contents;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		success=business.writeMessage(conduction_Id, message_Theme, message_Contents);
		if(success){
			message="消息信息已经发送,请耐心等候回复！";
		}else{
			message="对不起,信息发送失败，请重试！";
		}
		return SUCCESS;
	}
    
}
